
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -fpermissive")

file(GLOB_RECURSE SOURCE_FILES "*.cpp" "*.hpp" "*.c" "*.h")

add_executable(jingjia_jvm_cpp ${SOURCE_FILES} src/os/bsd/vm/os_bsd.cpp src/os/bsd/vm/os_bsd.hpp src/share/vm/runtime/os.cpp src/share/vm/runtime/os.hpp src/share/vm/prims/jvm.cpp src/share/vm/prims/jvm.hpp src/share/vm/runtime/mutexLocker.cpp src/share/vm/runtime/mutexLocker.h)

# enable warnings
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
    set_target_properties(jingjia_jvm_cpp PROPERTIES COMPILE_FLAGS "-Weverything")
elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
    set_target_properties(jingjia_jvm_cpp PROPERTIES COMPILE_FLAGS "-Wall -Wextra")
endif()

set_target_properties(jingjia_jvm_cpp PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "src/share/vm/precompiled/precompiled.hpp")
